{% load i18n %}
{% include "layout/header.html" %}
{% load i18n %}

<!-- {{ menu }} -->

<nav class="navbar navbar-default" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
                        aria-expanded="false" aria-controls="navbar">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="#">
                    <img src="{% if user.userprofile.picture %}{{ user.userprofile.picture.url }}{% else %}/media/profile_images/no_avatar.jpg{% endif %}"
								alt="User Icon" height="20" width="20" class="pull-left">

                    <div class="user-name">
                        <small>{% trans "Hello" %},</small>
                        {{ user }}</div>
                </a>

                <div id="navbar" class="navbar-collapse collapse pull-left">
                    <ul class="nav navbar-nav">
                        <li><a href="/main/">{% trans "Home" %}</a></li>
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
                               aria-expanded="false">{% trans "Projects" %} <span class="caret"></span></a>
                            <ul class="dropdown-menu" role="menu">
                                <li role="presentation"><a role="menuitem" tabindex="-1"
                                                           href="/project/1/add-user">{% trans "Create Project" %}</a>
                                </li>
                                {% for project in projects %}
                                    <li role="presentation"><a
                                            href="/project/{{ project.project.id }}">{{ project.project.title }}</a>
                                    </li>
                                {% endfor %}
                            </ul>
                        </li>
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
                               aria-expanded="false">Settings <span class="caret"></span></a>
                            <ul class="dropdown-menu" role="menu">
                                <li role="presentation"><a role="menuitem" tabindex="-1"
                                                           href="/project/{{ current_project.id }}/add-user">{% trans "Add user to project" %}</a>
                                </li>
								<li role="presentation"><a role="menuitem" tabindex="-1"
                                                           href="/project/{{ current_project.id }}/settings">{% trans "Change settings" %}</a>
                                </li>
                            </ul>
                        </li>
						<li><a href="/logout/">{% trans "Log out" %}</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </nav>

{% if messages %}
  {% for message in messages %}
    <p {% if message.tags %} class="alert alert-{{ message.tags }}"{% endif %}>{{ message }}</p>
  {% endfor %}
{% endif %}
<div class="row">
  <div class="project-info">
    <div class="project_title">
      <h2>{{ current_project.title }}</h2>
    </div>
    <div class="project_description">
      {{ current_project.description }}
    </div>
  </div>
  <div>
    <table data-toggle="table" class="table">
      <tr>
        {% for group in groups %}
          <td  class="group group-{{ group.id }}">
            <table data-toggle="table" class="table">
              <tr>
                <th>
                  <span class="group-name">{{ group }}</span>
                  <a href="/project/{{ current_project.id }}/add-task" class="add-task">{% trans 'Add task' %}</a>
                  <a href="/group/{{ group.id }}/edit" class="edit-group">{% trans 'Edit group' %}</a>
                </th>
              </tr>
              <tr>
                <td class="add-task-form"></td>
              </tr>
              {% for task in tasks %}
                <tr>
                  <td>{{ task.name }}</td>
                </tr>
              {% endfor %}
            </table>
          </td>
        {% endfor %}
      </tr>
    </table>
  </div>
</div>

{% include "layout/footer.html" %}